﻿using System;
using System.Collections.Generic; 
using System.ComponentModel;
using NTTDATA.BEENChina.ResultCertification.Config;

namespace NTTDATA.BEENChina.ResultCertification.Checker.Date
{
    [Serializable]
    [VerfityAttribute(Id = "VerfityRq0216", Name = "期间项目缺失_第N行", CategoryType = EnumCategoryType.日期, Model = true)]
    public class VerfityRq0216 : VerfityOneResult
    {
        [Category("设定检查的行"), Description("要检查的行")]
        public int Row { get; set; }

        /// <summary>
        /// 20130927 修改
        /// 第二行有值 并且只有一个
        /// </summary>
        /// <param name="result"></param>
        /// <param name="entryCommon"></param>
        /// <returns></returns>
        public override bool CheckResult(List<List<string>> result, string entryCommon)
        {
            bool bresult = false;

            if (result == null  || result.Count ==0 || result.Count < Row)
                return bresult;

            //第N行录入结果
            var rowResult = result[Row-1];
            

            if (Row - 1 < result.Count && Row - 1 > 0)
            {
                if (rowResult.Count >= 2)
                {
                  
                   int emptyColumn = EmptyColumnCount(rowResult);

                   if (emptyColumn == 1)
                   {
                       bresult = true;
                   }

                   
                }
            }

            if (bresult)
            {
                System.Console.WriteLine("VerfityRq0216");
            }

            return bresult;
        }
    }
}
